package com.qut.graduate.busrtquery;

import android.app.Application;
import android.app.Service;
import android.os.Vibrator;

import com.baidu.mapapi.SDKInitializer;
import com.qut.graduate.busrtquery.greendao.controller.DBController;
import com.qut.graduate.busrtquery.service.LocationService;
import com.qut.graduate.busrtquery.utils.common.ContextUtils;
import com.qut.graduate.busrtquery.utils.common.LogUtils;
import com.qut.graduate.busrtquery.utils.uiabout.ScreenUtils;

import cn.bmob.v3.Bmob;
import top.wefor.circularanim.CircularAnim;

/**
 * @Author WLL
 * @Time: 2019/3/27 22:04
 */
public class BRTQApp extends Application {
    private final static String TAG = "BRTQApp";
    public LocationService locationService;
    public Vibrator mVibrator;

    @Override
    public void onCreate() {
        super.onCreate();
        locationService = new LocationService(getApplicationContext());
        mVibrator =(Vibrator)getApplicationContext().getSystemService(Service.VIBRATOR_SERVICE);
        // 在使用 SDK 各组间之前初始化 context 信息，传入 ApplicationContext
        SDKInitializer.initialize(this);

        ContextUtils.init(this);
        LogUtils.setAllStatus(true);
        DBController.getInstance().init(ContextUtils.getContext());
        CircularAnim.init(700, 500, R.color.colorPrimary);
        Bmob.initialize(this, "cb36492603c0def8d608a74aed0642b8");

//        LogUtils.d("----屏幕最小宽度： " + ScreenUtils.getDeviceSmallestWidth() , getClass());
        /*//设置BmobConfig
        BmobConfig config = new BmobConfig.Builder(this)
                //设置appkey
                .setApplicationId(Constant.BOMB_APPID)
                //请求超时时间（单位为秒）：默认15s
                .setConnectTimeout(30)
                //文件分片上传时每片的大小（单位字节），默认512*1024
                .setUploadBlockSize(1024 * 1024)
                //文件的过期时间(单位为秒)：默认1800s
                .setFileExpiration(2500)
                .build();
        Bmob.initialize(config);*/
    }

}
